home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
grafica
/
amicad
/
arexx
/
conv2meta.amicad
< prev
next >
Wrap
Text File
|
1999-01-01
|
4KB
|
144 lines
/* Conversion du fichier courant sous le format META puis
conversion à l'aide du format spécifié à l'aide de MetaView.
Version 1.00: 18 février 1998, Chez Corbin
Version 1.01: 21 février 1999, modif appel REQFILE
$VER: Conv2META 1.01 (© R.Florac, 21/02/99) */
METAVIEW = 'DP:Système/MetaView/MetaView'
options results
SIGNAL ON FAILURE
signal on error
signal on syntax
APLPORT = ADDRESS()
'SAVE("RAM:AmiCAD.FILE")'
fichier="RAM:AmiCAD.META"
'LOCK(-1):TITLE("Conversion au format META en cours...")'
arguments=" RAM:AmiCAD.FILE TO "||'"'||fichier||'"'||" FORCE QUIET LIBS=Travail:AmiCAD/Bibliothèques"
address command
'run Travail:AmiCAD/AmiCAD2META' arguments
do NUMBER = 0 to 20
if (SHOW(PORTS,"METAVIEW." || NUMBER) = 0) then
leave
end
/*
** Searching for MetaView: 1. our path above,
** 2. path in env:MetaView.path
** or 3. you must have a assign "MetaView:"
*/
if (EXISTS(METAVIEW)=0) then do
if OPEN("MVVAR","env:MetaView.path","Read") then do
METAVIEW = READLN("MVVAR")
end
if (EXISTS(METAVIEW)=0) then do
METAVIEW = "MetaView:MetaView"
end
end
/*
** Enable warnings for WaitForPort
*/
OPTIONS FAILAT 5
ADDRESS COMMAND
"run " || METAVIEW || " NODISPLAY"
MVPORT = "METAVIEW." || NUMBER
"WaitForPort " || MVPORT
OPTIONS FAILAT 21
ADDRESS(APLPORT)
titre='"Format sauvegarde"+CHR(10)+"AMF (Amiga MetaFile)"+CHR(10)+"WMF (Windows MetaFile)"+CHR(10)+"DR2D (Drawing 2D)"+CHR(10)+"CGM (ComputerGraphicMetafile)"+CHR(10)+"GEM"+CHR(10)+"EPS (Encapsulated PostScript)"+CHR(10)+"AI (Adobe Illustrator)"+CHR(10)'
titre=titre||'+"HPGL (Hewlett-Packard Graphics Language)"+CHR(10)+"ILBM (InterLeaved BitMap)"+CHR(10)+"JMF (Java MetaFile)"+CHR(10)+"FIG"+CHR(10)+"META"+CHR(10)'
'TITLE(""):SELECT('titre')'
CHOICE = result
if result>0 then do
extension.1 = "AMF"
extension.2 = "WMF"
extension.3 = "DR2D"
extension.4 = "CGM"
extension.5 = "GEM"
extension.6 = "EPS"
extension.7 = "AI"
extension.8 = "HPGL"
extension.9 = "ILBM"
extension.10= "JMF"
extension.11= "FIG"
extension.12= "META"
'REQFILE("Fichier 'extension.CHOICE' destination?","RAM:", FILEPART("")+".'extension.CHOICE'")'
FILENAME=result
if FILENAME~="" then do
if POS(extension.CHOICE,FILENAME)=0 then FILENAME=FILENAME||"."||extension.CHOICE
FILENAME='"'||FILENAME||'"'
ADDRESS VALUE MVPORT
LOAD fichier
select
when CHOICE = 1 then do
SAVE FILENAME AS AMF
end
when CHOICE = 2 then do
SAVE FILENAME AS WMF
end
when CHOICE = 3 then do
SAVE FILENAME AS DR2D
end
when CHOICE = 4 then do
SAVE FILENAME AS CGM
end
when CHOICE = 5 then do
SAVE FILENAME AS GEM
end
when CHOICE = 6 then do
SAVE FILENAME AS EPS
end
when CHOICE = 7 then do
SAVE FILENAME AS AI
end
when CHOICE = 8 then do
SAVE FILENAME AS HPGL
end
when CHOICE = 9 then do
SAVE FILENAME AS ILBM
end
when CHOICE = 10 then do
SAVE FILENAME AS JMF
end
when CHOICE = 11 then do
SAVE FILENAME AS FIG
end
otherwise do
ADDRESS COMMAND
'c:copy' " RAM:AmiCAD.META TO "||FILENAME
end
end
end
end
fin:
ADDRESS COMMAND
'c:delete' " RAM:AmiCAD.FILE RAM:AmiCAD.META QUIET"
ADDRESS(APLPORT)
'UNLOCK(-1):TITLE("")'
EXIT
/* Traitement des erreurs, interruption du programme */
FAILURE:
syntax:
erreur=RC
ADDRESS(APLPORT)
'MESSAGE("Script Conv2META"+CHR(10)+"Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'"):UNLOCK(-1)'
exit
error:
ADDRESS(APLPORT)
'MESSAGE("Script Conv2META"+CHR(10)+"Erreur en ligne 'SIGL'"):UNLOCK(-1)'
exit